package com.htstar.ovms.report.controller;

import com.htstar.ovms.common.core.util.R;
import com.htstar.ovms.report.api.req.AlarmReportReq;
import com.htstar.ovms.report.api.req.ByAlarmReportPageReq;
import com.htstar.ovms.report.api.req.ByViolationsNoSingleCarReportPageReq;
import com.htstar.ovms.report.api.req.ViolationsNoSingleCarReportReq;
import com.htstar.ovms.report.api.vo.AlarmReportVO;
import com.htstar.ovms.report.api.vo.AlarmTotalPageVO;
import com.htstar.ovms.report.api.vo.VNCarTotalPageVO;
import com.htstar.ovms.report.api.vo.ViolationsNoSingLeCarReportVO;
import com.htstar.ovms.report.service.AlarmReportService;
import com.htstar.ovms.report.service.ViolationsNoSingleCarReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * @author JinZhu
 * @Description:
 * @date 2020/8/319:36
 */
@RestController
@AllArgsConstructor
@RequestMapping("/alarmReport")
@Api(value = "超速 越界报表", tags = "超速 越界报表/Speeding out of bounds report")
public class AlarmReportController {

    @Autowired
    AlarmReportService alarmReportService;

    @PostMapping("/monthReport")
    @ApiOperation(value = "按月统计违规 无单记录/Count violations on a monthly basis, no single record", notes = "按月统计违规 无单记录")
    public  R<List<AlarmReportVO>> drivingReport(@Valid @RequestBody AlarmReportReq req) {
        return  alarmReportService.AlarmReportI(req);
    }

    @PostMapping("/vceMonthReport")
    @ApiOperation(value = "按车辆统计超速越界记录/Statistics of speeding and out-of-bounds records by vehicle", notes = "按辆统计超速越界记录")
    public R<AlarmTotalPageVO> vceDrivingReport(@Valid @RequestBody ByAlarmReportPageReq req) {
        return alarmReportService.vceUserReport(req);
   }

    @PostMapping("/userMonthReport")
    @ApiOperation(value = "按人员统计超速越界记录/Statistics of speeding and out of bounds records by personnel", notes = "按人员统计行驶记录")
    public R<AlarmTotalPageVO> drivceMonthReport(@Valid @RequestBody ByAlarmReportPageReq req) {
        return alarmReportService.vceCarReport(req);
    }
}
